package com.googlecode.continuity.plugin.codecomment.client;

import java.util.List;

import com.google.gwt.user.client.rpc.RemoteService;
import com.googlecode.continuity.core.client.Reply;

/**
 * CodeCommentRPC
 *
 * @author Peter Schmitt <aragos@aragos.de>
 */
public interface CodeCommentRPC extends RemoteService {
  /**
   * Retrieves all comments registered for a file (with version, requested lines, url etc given by a code pointer).
   *
   * @param pointer file identifying pointer
   * @return a list of comments submitted for this file
   * @gwt.typeArgs <com.googlecode.continuity.plugin.codecomment.client.CodeComment>
   */
  List getCommentsForFile(CodePointer pointer);

  /**
   * Retrieves all comments registered for a file (with requested lines, url etc given by a code pointer and version
   * bounds given explicitely).
   *
   * @param pointer      file identifying pointer
   * @param firstVersion first version for which to retrieve comments (inclusive)
   * @param lastVersion  last version for which to retrieve comments (inclusive)
   * @return a list of comments submitted for this file
   * @gwt.typeArgs <com.googlecode.continuity.plugin.codecomment.client.CodeComment>
   */
  List getCommentsForFile(CodePointer pointer, long firstVersion, long lastVersion);

  CodeComment addComment(CodeComment comment);

  Reply addReply(CodeComment comment, Reply reply);
}
